#pragma once

#include "../SGD Wrappers/SGD_Geometry.h"
#include "../SGD Wrappers/SGD_Color.h"
#include "../SGD Wrappers/SGD_String.h"
#include "../SGD Wrappers/SGD_GraphicsManager.h"
#include "BaseObject.h"

class Flyweight 
{
public:

	Flyweight();
	Flyweight(BaseObject& owner);
	~Flyweight();

	void			LoadTexture();
	void			UnloadTexture();
	void			AddRef();
	void			Release();

	//Accessors
	std::string		GetImageID()			const	{ return m_szImageID; }
	SGD::Color		GetColor()				const	{ return m_Color; }
	float			GetScale()				const	{ return m_fScale; }
	float			GetRotation()			const	{ return m_fRotation; }
	SGD::Vector		GetMinVelocity()		const	{ return m_v2fMinVelocity; }
	SGD::Vector		GetMaxVelocity()		const	{ return m_v2fMaxVelocity; }
	float			GetMinLife()			const	{ return m_fMinLife; }
	float			GetMaxLife()			const	{ return m_fMaxLife; }
	SGD::Color		GetChangeInColor()		const   { return m_ChangeInColor; }
	float			GetChangeInScale()		const   { return m_fChangeInScale; }
	float			GetChangeInRotation()	const   { return m_fChangeInRotation; }
	SGD::Vector		GetChangeInVelocity()	const   { return m_ChangeInVelocity; }
	SGD::HTexture	GetTexture()			const	{ return m_hTexture; }
	BaseObject*		GetOwner()				const	{ return m_pOwner; }
	unsigned int	GetTextureWidth()		const	{ return m_nTextureWidth; }
	unsigned int	GetTextureHeight()		const	{ return m_nTextureHeight; }
	unsigned int	GetRefCount()			const	{ return m_unRefCount; }

	//Mutators
	void			SetImageID(const char * str);
	void			SetColor(SGD::Color clr)			{ m_Color = clr; }
	void			SetScale(float scale)				{ m_fScale = scale; }
	void			SetRotation(float rotation)			{ m_fRotation = rotation; }
	void			SetMinVelocity(SGD::Vector vel)		{ m_v2fMinVelocity = vel; }
	void			SetMaxVelocity(SGD::Vector vel)		{ m_v2fMaxVelocity = vel; }
	void			SetMinLife(float minLife)			{ m_fMinLife = minLife; }
	void			SetMaxLife(float maxLife)			{ m_fMaxLife = maxLife; }
	void			SetChangeInColor(SGD::Color clr)	{ m_ChangeInColor = clr; }
	void			SetChangeInScale(float scale)		{ m_fChangeInScale = scale; }
	void			SetChangeInRotation(float rot)		{ m_fChangeInRotation = rot; }
	void			SetChangeInVelocity(SGD::Vector vec){ m_ChangeInVelocity = vec; }
	void			SetTextureWidth(unsigned int width)		{ m_nTextureWidth = width; }
	void			SetTextureHeight(unsigned int height)		{ m_nTextureHeight = height; }

private:			
	std::string		m_szImageID;
	SGD::Color		m_Color;
	float			m_fScale;
	float			m_fRotation;
	SGD::Vector		m_v2fMinVelocity;
	SGD::Vector		m_v2fMaxVelocity;

	float			m_fMinLife;
	float			m_fMaxLife;

	SGD::Color		m_ChangeInColor;
	float			m_fChangeInScale;
	float			m_fChangeInRotation;
	SGD::Vector		m_ChangeInVelocity;

	SGD::HTexture	m_hTexture;
	unsigned int	m_nTextureWidth;
	unsigned int	m_nTextureHeight;
	unsigned int	m_unRefCount;

	BaseObject*		m_pOwner;
};